<?php
/**
 * Class 购物车.
 * User: chan
 * Date: 2017/10/20 11:22
 */

namespace app\api\controller;
class Cart extends Base
{
    //检查权限作用域
    protected $beforeActionList  = [
        'checkPrimaryScope' => [
            'except' => 'except'
        ],
    ];

    /**
    *   购物车列表
    */
    public function cartList(){
        $cartList =  (new \app\api\logic\Cart())->cartList();
        return $this->ajaxReturn($cartList);
    }

    /**
     *  购物车添加
     */
    public function cartAdd()
    {
        $cartAdd =  (new \app\api\logic\Cart())->cartAdd();
        return $this->ajaxReturn($cartAdd);
    }

    /**
    *  购物车删除
    */
    public function cartDel(){
        $cartDel =  (new \app\api\logic\Cart())->cartDel();
        return $this->ajaxReturn($cartDel);
    }

    /**
    *   购物车更新
    */
    public function cartUpdate(){
        $cartUpdate =  (new \app\api\logic\Cart())->cartUpdate();
        return $this->ajaxReturn($cartUpdate);
    }
}